package com.newtouch.bxzs.business.personal.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.newtouch.bxzs.common.base.model.User;

/**
 * 用户个人信息mapper
 *
 * <p>
 * <b>History:</b>
 * <table border="1">
 * <tr>
 * <th>Date</th>
 * <th>Operator</th>
 * <th>Memo</th>
 * </tr>
 * <tr>
 * <td>2020年12月28日</td>
 * <td>xiongdianqiang</td>
 * <td>Create</td>
 * </tr>
 * </table>
 * 
 * @author xiongdianqiang
 * 
 * @version 1.0.0
 * @since 1.0.0
 */
@Mapper
public interface PersonalMapper extends BaseMapper<User> {
	@Select("SELECT GROUP_CONCAT(B.POSITION_NAME SEPARATOR '、') FROM ASSISTANT_USER_POSITION_MAP A \n"
			+ "LEFT JOIN ASSISTANT_POSITION B ON A.POSITION_ID = B.POSITION_ID WHERE A.USER_ID = #{userId} \n"
			+ "AND B.IS_DELETE = 0 GROUP BY A.USER_ID")
	String selectPositionNameByUserId(String userId);

}
